package com.sfy.controller;

import com.sfy.dao.CostMapper;
import com.sfy.entity.Cost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class CostController {
    @Autowired
    private CostMapper costMapper;
    @RequestMapping("/selectCostList")
    public List<Cost> selectCostList(Cost cost){
        return costMapper.selectCostList(cost);
    }
    @RequestMapping("/getCostCount")
    public int getCostCount(Cost cost){
        return costMapper.getCount(cost);
    }
    @RequestMapping("/addCost")
    public void addCost(Cost cost){
        costMapper.addCost(cost);
    }
}
